package zy2;

/**
 * 圆
 */
public class Circle extends Graph{
    private final double PI = 3.14;
    private int r;

    public Circle() {

    }

    public Circle(int r) {
        this.setR(r);
    }

    public double getPI() {
        return PI;
    }

    public int getR() {
        return r;
    }

    public void setR(int r) {
        this.r = r;
    }

    @Override
    public void perimeter() {
        double zc = 2* getPI() * getR();
        System.out.println("圆的周长:"+zc);
    }

    @Override
    public void area() {
        double mj = getPI() * getR() * getR();
        System.out.println("圆的面积:"+mj);
    }
}
